home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 412_01 / include / tree.h < prev   
Encoding:
C/C++ Source or Header  |  1993-12-29  |  2.7 KB  |  127 lines

  1. #ifndef _tree_H_
  2. #define _tree_H_
  3.  
  4. #include <stdio.h>
  5. #include "nodes.h"
  6. #include "search.h"
  7. #include "bisearch.h"
  8. #include "aosearch.h"
  9.  
  10. /*                 DEPTH_TREE_
  11.  
  12.     This class implements a depth first search algorithm, by generating
  13.     a search TREE. It is derived from class SEARCH_.
  14.  
  15. */
  16.  
  17. class DEPTH_TREE_ : public SEARCH_
  18. {
  19.     public:
  20.         DEPTH_TREE_(NODE_ *, NODE_ *, int);
  21.         int add(NODE_ *);
  22. };
  23.  
  24.  
  25.  
  26. /*                  BREADTH_TREE_
  27.  
  28.     This class implements a breadth first search algorithm, by generating
  29.     a search TREE. It is derived from class SEARCH_.
  30.  
  31. */
  32.  
  33. class BREADTH_TREE_ : public SEARCH_
  34. {
  35.     public:
  36.         BREADTH_TREE_(NODE_ *, NODE_ *, int);
  37.         int add(NODE_ *);
  38. };
  39.  
  40.  
  41.  
  42. /*               UNICOST_TREE_
  43.  
  44.     This class implements a uniform cost search algorithm, by generating
  45.     a search TREE. It is derived from class SEARCH_ and processes nodes
  46.     of class UNI_NODE_. Classes that are derived from class UNICOST_T_
  47.     should have the following function:
  48.  
  49.     compute_g() : to compute the G-value of a node.
  50.  
  51. */
  52.  
  53. class UNICOST_TREE_ : public SEARCH_
  54. {
  55.     public:
  56.         UNICOST_TREE_(UNI_NODE_ *, UNI_NODE_ *, int);
  57.         int add(NODE_ *);
  58.         virtual int compute_g(const NODE_ &) = 0;
  59. };
  60.  
  61.  
  62.  
  63.  
  64. /*                    BIDEPTH_TREE_
  65.  
  66.     This class implements a bidirectional depth first search algorithm,
  67.     by generating two search TREEs. It is derived from class BISEARCH_.
  68.  
  69. */
  70.  
  71. class BIDEPTH_TREE_ : public BISEARCH_
  72. {
  73.     public:
  74.         BIDEPTH_TREE_(NODE_ *, NODE_ *, int);
  75.         int add(SORTEDLIST_ *, SORTEDLIST_ *, NODE_ *);
  76. };
  77.  
  78.  
  79.  
  80. /*                   BIBREADTH_TREE_
  81.  
  82.     This class implements a bidirectional breadth first search algorithm,
  83.     by generating two search TREEs. It is derived from class BISEARCH_.
  84.  
  85. */
  86.  
  87. class BIBREADTH_TREE_ : public BISEARCH_
  88. {
  89.     public:
  90.         BIBREADTH_TREE_(NODE_ *, NODE_ *, int);
  91.         int add(SORTEDLIST_ *, SORTEDLIST_ *, NODE_ *);
  92. };
  93.  
  94.  
  95.  
  96. /*                    AODEPTH_TREE_
  97.  
  98.     This class implements a depth first AND-OR search algorithm, by
  99.     generating a AND-OR search TREE. It is derived from class AOSEARCH_.
  100.  
  101. */
  102.  
  103. class AODEPTH_TREE_ : public AOSEARCH_
  104. {
  105.     public:
  106.         AODEPTH_TREE_(AONODE_ *, int);
  107.         void add(AONODE_ *);
  108. };
  109.  
  110.  
  111.  
  112. /*                     AOBREADTH_TREE_
  113.  
  114.     This class implements a breadth first AND-OR search algorithm, by
  115.     generating an AND-OR search TREE. It is derived from class AOSEARCH_.
  116.  
  117. */
  118.  
  119. class AOBREADTH_TREE_ : public AOSEARCH_
  120. {
  121.     public:
  122.         AOBREADTH_TREE_(AONODE_ *, int);
  123.         void add(AONODE_ *);
  124. };
  125.  
  126. #endif
  127.